/*************************************************************************
	> File Name: AwinicAPI.h
	> Author: 
	> Mail: 
	> Created Time: 2018/1/23 Tue 18:32
	> Version     :
 ************************************************************************/

#ifndef _AWINICAPI_H
#define _AWINICAPI_H
#include <stdint.h>

typedef int ADSPResult;

typedef struct media_info{
    uint32_t num_channels;
    uint32_t bits_per_sample;
    uint32_t sampling_rate;
    uint32_t data_is_signed;
}media_info_t;


/* The operation completed with no errors. */
/* Success.*/
#define ADSP_EOK          ( 0  )
/** General failure. */
#define ADSP_EFAILED      ( 1  )
/** Bad operation parameter. */
#define ADSP_EBADPARAM    ( 2  )
/** Unsupported routine or operation. */
#define ADSP_EUNSUPPORTED ( 3  )
/** Unsupported version. */
#define ADSP_EVERSION     ( 0x00000004  )
/** Unexpected problem encountered. */
#define ADSP_EUNEXPECTED  ( 0x00000005  )

typedef enum enableMode{
	byPass,                   //Bypass Mode Close Module
	leftChEnable,             //Only Left Channel Enable
	rightChEnable,            //Only Right Channel Enable
	twoChEnable,              //Left And Right Channel Enable
	twoChMixEnable,           //Two Channel Mix And Enable
	sinWave,                  //Sine Wave
}enableMode_t;


ADSPResult AwinicGetSize(uint32_t *requestSize_ptr);
ADSPResult AwinicInit(void *aw_ptr,media_info_t *info);
ADSPResult AwinicReset(void *aw_ptr);
ADSPResult AwinicSetParams(void *aw_ptr,void *param_ptr,uint16_t paramsBytesSize);
ADSPResult AwinicGetParams(void *aw_ptr,void *param_ptr,uint16_t *paramsBytesSize);
ADSPResult AwinicEnd(void *aw_ptr);
ADSPResult AwinicHandle(void *aw_ptr,void *dataBuf,uint16_t bytes,enableMode_t enable);

#endif
